package teamRocketServer;

import java.util.ArrayList;

public class ColorettoServer {
    
    private static ArrayList<Game> gameList = new ArrayList();
    public static void main(String[] args) {}
    public static String getGames(){
	String game ;
	game = gameList.get(0).toString();
	return game;
    }
    
    public static void runMethod(String input){
   	String cmd;
   	int method;
   	int attr1;
  	int attr2;
  	int attr3;
  	int attr4;
   	String overhead;
   	
   	cmd = input.substring(0, 2);
   	method = Integer.parseInt(cmd);
 	cmd = input.substring(2, 4);
   	attr1 = Integer.parseInt(cmd);
 	cmd = input.substring(4, 6);
   	attr2 = Integer.parseInt(cmd);
 	cmd = input.substring(6, 11);
   	attr3 = Integer.parseInt(cmd);
 	cmd = input.substring(11, 16);
   	attr4 = Integer.parseInt(cmd);
   	overhead = input.substring(16, input.length());
   	
   	switch(method){
   		case 01 :{ 
   		    System.out.println("1");
   		    gameList.add(new Game(attr1,overhead));
   		    break;
   		    }
   		case 2 :{
   		    System.out.println("2");
   		    System.out.println(gameList.get(0).getCard().getColor());

   		    break;
   		   } 
   		case 3 :{
      		    System.out.println("3");
      		    System.out.println(gameList.get(attr1).toString());

      		    break;
      		   }
   		default :{ 
   		    System.out.println("default");
   		    System.out.println(overhead);
   		    break;
   		    }
   		}
   	}
    
    

}
